﻿function getXmlHttp() {
    var xmlHttp;
    try {
        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e1) {
        try {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e2) {
            xmlHttp = false;
        }
    }
    if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
        xmlHttp = new XMLHttpRequest();
    }
    return xmlHttp;
}

var IsGuestFormOpened = false;
var commentDiv = document.getElementById("new-comment");

$("#new-comment").click(
    function () {
        if (IsGuestFormOpened) {
            IsGuestFormOpened = false;
            commentDiv.innerText = "Оставить комментарий";
            $("#new-comment-fieldset").hide(500);
        } else {
            IsGuestFormOpened = true;
            commentDiv.innerText = "Закрыть форму";
            $("#new-comment-fieldset").show(500);
        }
    }
    );